<?php
declare (strict_types = 1);

namespace app\listener\backend;

use Exception;
use think\facade\Log;
use app\service\logic\common\system\AdminService;

class AfterPasswordListener
{
    /**
     * @param $argc
     * @return mixed
     */
    public function handle($argc)
    {
        try {
            return invoke(AdminService::class)->deleteAccessTokenByAdminId($argc['id']);
        } catch (Exception $e) {
            Log::debug('AfterPasswordListenerException: id=' . $argc['id'] . ', token=' . $argc['token'] . ', message=' . $e->getMessage());
            return true;
        }
    }
}
